#include "stdafx.h"
#include <LitNameGenerator.h>
#include <LitString.h>

namespace Lit
{
	NameGenerator::NameGenerator( const String &base, const String &ext, const String &separator ) : mBase( base ), mSep( separator ), mCounter( 0 ), mExt(ext){}
	NameGenerator::NameGenerator( const NameGenerator &nmr ) : mSep( nmr.mSep ), mCounter( nmr.mCounter ), mBase( nmr.mBase ), mExt(nmr.mExt){}

	String NameGenerator::peek(bool with_ext) const{ 
		return (mBase+mSep+String::from(mCounter)+(with_ext?String(String(".")+mExt):String(""))); 
	}
	String NameGenerator::generate(bool with_ext){ String ret(peek(with_ext)); mCounter++; return ret; }
	void NameGenerator::reset(){ mCounter=0; }

	void NameGenerator::_setCount(size_t cnt ){ mCounter=cnt; }
};